import request from '@/utils/request.js';
import { setting } from '@/config/setting';
const { tokenName } = setting;
export const login = async (data) => {
  return request({
    url: '/pc/Admin/index',
    method: 'post',
    data,
  }).then((res) => {
    localStorage.setItem('data', JSON.stringify(res));
    return res;
  });
};

export const getUserInfo = (accessToken) => {
  return request({
    url: '/userInfo',
    method: 'get',
    data: {
      [tokenName]: accessToken,
    },
  });
};

export const logout = () => {
  return request({
    url: '/logout',
    method: 'post',
  });
};

export const register = async () => {
  return request({
    url: '/register',
    method: 'post',
  });
};

export const Outpatientpayment = async () => {
  return request({
    url: '/pc/pay/index',
    method: 'post',
  });
};

export const Outpatientxq = async (data) => {
  return request({
    url: '/pc/pay/details',
    method: 'post',
    data,
  });
};
export const ZDdetailed = async (data) => {
  return request({
    url: '/pc/paycord/index',
    method: 'post',
    data,
  });
};
export const Drug = async () => {
  return request({
    url: '/pc/Drug/index',
    method: 'post',
  });
};
export const Tlmin = async (data) => {
  return request({
    url: '/pc/paycord/add',
    method: 'post',
    data,
  });
};
export const Closed = async (data) => {
  return request({
    url: '/pc/paycord/del',
    method: 'post',
    data,
  });
};
export const Yuel = async () => {
  return request({
    url: '/pc/register/index',
    method: 'post',
  });
};
export const Tlist = async () => {
  return request({
    url: '/pc/Package/index',
    method: 'post',
  });
};
export const Statusyy = async (data) => {
  return request({
    url: '/pc/register/edit',
    method: 'post',
    data,
  });
};
export const Delyy = async (data) => {
  return request({
    url: '/pc/register/del',
    method: 'post',
    data,
  });
};
export const Bslu = async () => {
  return request({
    url: '/pc/report/index',
    method: 'post',
  });
};
export const Yyinfo = async (data) => {
  return request({
    url: '/pc/hospital/add',
    method: 'post',
    data,
  });
};
export const Ttclist = async () => {
  return request({
    url: '/pc/Package/index',
    method: 'post',
  });
};
export const Ttitem = async () => {
  return request({
    url: '/pc/item/index',
    method: 'post',
  });
};
export const Tttype = async () => {
  return request({
    url: '/pc/packages/index',
    method: 'post',
  });
};
export const pay_add = async (data) => {
  return request({
    url: '/pc/pay/add',
    method: 'post',
    data,
  });
};
export const pay_edit = async (data) => {
  return request({
    url: '/pc/pay/edit',
    method: 'post',
    data,
  });
};
export const scheduling_list = async (data) => {
  return request({
    url: '/pc/scheduling/index',
    method: 'post',
    data,
  });
};
// 添加1
export const requestAddOne = (data) => {
  console.log(data);
  return request({
    url: '/pc/Package/add',
    method: 'post',
    data: {
      ...data,
    },
  }).then((res) => {
    return res;
  });
};
// 添加2
export const requestAddTwo = (data) => {
  console.log(data);
  return request({
    url: '/pc/Item/add',
    method: 'post',
    data: {
      ...data,
    },
  }).then((res) => {
    return res;
  });
};
// 添加3
export const requestAddThree = (data) => {
  console.log(data);
  return request({
    url: '/pc/Packages/add',
    method: 'post',
    data: {
      ...data,
    },
  }).then((res) => {
    return res;
  });
};
// 删除1
export const requestDeleteOne = (data) => {
  console.log(data);
  return request({
    url: '/pc/Package/del',
    method: 'post',
    data: {
      ...data,
    },
  }).then((res) => {
    return res;
  });
};
// 删除2
export const requestDeleteTwo = (data) => {
  console.log(data);
  return request({
    url: '/pc/item/del',
    method: 'post',
    data: {
      ...data,
    },
  }).then((res) => {
    return res;
  });
};
// 删除3
export const requestDeleteThree = (data) => {
  console.log(data);
  return request({
    url: '/pc/packages/del',
    method: 'post',
    data: {
      ...data,
    },
  }).then((res) => {
    return res;
  });
};
export const scheduling_add = async (data) => {
  return request({
    url: '/pc/scheduling/add',
    method: 'post',
    data,
  });
};
export const room_hospital = async (data) => {
  return request({
    url: '/pc/room/hospital',
    method: 'post',
    data: {
      ...data,
    },
  });
};


export const Yanxq = async (data) => {
  return request({
    url: '/pc/report/details',
    method: 'post',
    data,
  });
};
export const Yanming = async (data) => {
  return request({
    url: '/pc/reportcord/index',
    method: 'post',
    data,
  });
};

export const Zydel = async (data) => {
  return request({
    url: '/pc/report/del',
    method: 'post',
    data,
  });
};

